package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
)

func main() {

	url := "http://58.33.66.182:8888/GeneralSMS/pointSendMsg"
	method := "POST"

	payload := strings.NewReader(`{
    "loginName": "hjapp",
    "orgId": "10001",
    "batchNo": 1,
    "p": [
        {
            "text": "code=5288",
            "password": "HJSHadmin@2020",
            "to": "18515154760",
            "smsId": "esk-96886733194073670610"
        }
    ]
}`)

	client := &http.Client {
	}
	req, err := http.NewRequest(method, url, payload)

	if err != nil {
		fmt.Println(err)
	}
	req.Header.Add("Content-Type", "application/json")

	res, err := client.Do(req)
	if err != nil {
		fmt.Printf("req err: %+v\n", err)
	}

	fmt.Printf("%+v\n", res)
	defer res.Body.Close()
	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		fmt.Printf("req err: %+v, resp: %+v\n", err, string(body))
	}

	fmt.Printf("resp body: %+v\n", string(body))
}